<cfparam name="dir" default="/">
<cfif isdefined('form.newdir')>
  <cfif len(trim(form.newdir)) GT 0>
    <cfset NewFolderName = replace(form.newdir, "'", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, '"', '', 'ALL')>
    <cfset NewFolderName = replace(NewFolderName, "*", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, "&", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, "(", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, ")", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, ";", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, ":", "", "ALL")>
    <cfset NewFolderName = replace(NewFolderName, "!", "", "ALL")>
    <cfset fullpath = "#request.basepath#images#dir##NewFolderName#">
    <cfset fullpath = replacenocase(fullpath, "//", "/", "ALL")>
    <cfdirectory action="create" directory="#fullpath#">
  </cfif>
</cfif>
<cflocation url="index.cfm?c=imagelibrary&showfolders=1">
